package com.lanqiaofinal11;

import java.io.*;
import java.util.Arrays;

/**
 * @author `RKC`
 * @date 2022/6/17 13:49
 */
public class H画廊_状压DP {

    private static final int N = 22, INF = 0x3f3f3f3f;
    private static double[][] p = new double[N][2], g = new double[N][N], f = new double[1 << N][N];
    private static int l, r, d, w, n;

    private static StreamTokenizer tokenizer = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    private static PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        l = nextInt(); r = nextInt(); d = nextInt(); w = nextInt();
        n = l + r + 2;
        p[0][0] = w / 2.0;
        for (int i = 1; i <= l; i++) p[i][1] = nextInt();
        for (int i = l + 1; i <= l + r; i++) {
            p[i][0] = w;
            p[i][1] = nextInt();
        }
        p[n - 1][0] = w / 2.0;
        p[n - 1][1] = d;
        build();
        writer.format("%.2f\n", resolve());
        writer.flush();
    }

    private static double resolve() {
        for (int i = 0; i < 1 << n; i++) Arrays.fill(f[i], INF);
        f[1][0] = 0;
        for (int s = 0; s < 1 << n; s++) {
            for (int i = 0; i < n; i++) {
                if ((s >> i & 1) == 0) continue;
                for (int j = 0; j < n; j++) {
                    if ((s >> j & 1) == 1) continue;
                    f[s | (1 << j)][j] = Math.min(f[s | (1 << j)][j], f[s][i] + g[i][j]);
                }
            }
        }
        return f[(1 << n) - 1][n - 1];
    }

    private static void build() {
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (i == j) continue;
                g[i][j] = get(i, j);
            }
        }
    }

    private static double get(int i, int j) {
        double x1 = p[i][0], y1 = p[i][1], x2 = p[j][0], y2 = p[j][1];
        return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
    }

    private static int nextInt() throws IOException {
        tokenizer.nextToken();
        return (int) tokenizer.nval;
    }
}
